# -*- coding: utf-8 -*-
from django.db.models import get_models, signals
from django.contrib.auth import models as auth_app

def create_superuser(app, created_models, verbosity, **kwargs):
    from django.contrib.auth.models import User
    
    if User in created_models and not User.objects.all():
        User.objects.create_superuser('admin', 'admin@123.com', 'admin')
        print "\nCreated  superuser admin\n"
        
signals.post_syncdb.connect(create_superuser,sender=auth_app)